//---------------------------------------------------------------------------

#ifndef routeSFH
#define routeSFH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "AdvToolBar.hpp"
#include "AdvToolBarStylers.hpp"
#include "AdvGrid.hpp"
#include "AdvObj.hpp"
#include "BaseGrid.hpp"
#include <Vcl.Grids.hpp>
#include "AdvEdit.hpp"
#include "AdvGlowButton.hpp"
#include "AdvGroupBox.hpp"
#include <Vcl.ComCtrls.hpp>
#include <Data.DB.hpp>
#include <Data.Win.ADODB.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.Imaging.pngimage.hpp>
//---------------------------------------------------------------------------
class Troute : public TAdvToolBarForm
{
__published:	// IDE-managed Components
	TAdvToolBarPager *tb1;
	TAdvToolBarOfficeStyler *advtlbrfcstylr1;
	TAdvGroupBox *grpParams;
	TLabel *lbl1;
	TAdvGlowButton *btnEdit;
	TAdvGlowButton *btnDel;
	TAdvStringGrid *sgStops;
	TAdvGlowButton *btnUp;
	TAdvGlowButton *btnDown;
	TAdvGlowButton *btn1;
	TADOQuery *qAdd;
	TDataSource *dsAdd;
	TADOQuery *qLoad;
	TDataSource *dsLoad;
	TComboBox *cbName;
	TLabel *lblRoute;
	void __fastcall FormShow(TObject *Sender);
	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
	void __fastcall btnUpClick(TObject *Sender);
	void __fastcall btnDownClick(TObject *Sender);
	void __fastcall btn1Click(TObject *Sender);
	void __fastcall btnEditClick(TObject *Sender);
	void __fastcall btnDelClick(TObject *Sender);
	void __fastcall cbNameChange(TObject *Sender);
	void __fastcall cbNameKeyPress(TObject *Sender, System::WideChar &Key);
	void __fastcall FormResize(TObject *Sender);
private:	// User declarations
public:		// User declarations
	__fastcall Troute(TComponent* Owner);
	void __fastcall MoveStop(int iRow,int iDirect);
	int __fastcall AddNewRoute();
	void __fastcall AddRoutePoint(int iRouteId);
	int __fastcall CheckFields();
	bool bNewRoute;
	int r_id;
	void __fastcall ListRoute();
	void __fastcall LoadRoute(int iId);
	void __fastcall MarkStops();
	void __fastcall DeleteRoute(int iId);
	void __fastcall UpdRoute(int iRouteId);
	void __fastcall UpdRDesc(int iRouteId);
	void __fastcall RenewRoutePoint(int iRouteId);
	friend void __fastcall FillCombo(TComboBox *Combo,String db_table,bool bSort,String sFieldName,bool bClearBefore,bool bGroup);
};
//---------------------------------------------------------------------------
extern PACKAGE Troute *route;
//---------------------------------------------------------------------------
#endif
